/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.basics.editor.model.document;

import java.rmi.server.UID;

import com.genia.toolbox.basics.i18n.I18nMessage;
import com.genia.toolbox.web.portlet.description.ContainerPortletDescription.LayoutDirection;

/**
 * The document element.
 * 
 * @param <T>
 *          The generic type.
 */
public interface Element<T extends ElementType>
{
  /**
   * Get the element description.
   * 
   * @return the element description.
   */
  public I18nMessage getDescription();



  /**
   * Set the element description.
   * 
   * @param description
   *          the element description.
   */
  public void setDescription(I18nMessage description);



  /**
   * Get the element name.
   * 
   * @return the element name.
   */
  public String getName();



  /**
   * Set the element name.
   * 
   * @param name
   *          the element name.
   */
  public void setName(String name);



  /**
   * Get the element unique ID.
   * 
   * @return the element unique ID.
   */
  public UID getUniqueID();



  /**
   * Get the document unique ID.
   * 
   * @return the document unique ID.
   */
  public UID getDocumentID();



  /**
   * Set the document unique ID.
   * 
   * @param documentID
   *          the document unique ID.
   */
  public void setDocumentID(UID documentID);



  /**
   * Get the type.
   * 
   * @param type
   *          The type.
   */
  public void setType(T type);



  /**
   * Set the type.
   * 
   * @return type The type.
   */
  public T getType();



  /**
   * Get whether the settings are valid.
   * 
   * @return whether the settings are valid.
   */
  public boolean accept();



  /**
   * Get whether the element is a sub-element.
   * 
   * @return whether the element is a sub-element.
   */
  public boolean isSubElement();



  /**
   * Get whether the element has at least one sub-element.
   * 
   * @return whether the element has at least one sub-element.
   */
  public boolean isContainer();



  /**
   * Set whether the element is a sub-element.
   * 
   * @param isSubElement
   *          whether the element is a sub-element.
   */
  public void setSubElement(boolean isSubElement);



  /**
   * Get the parent direction.
   * 
   * @return the parent direction.
   */
  public LayoutDirection getParentDirection();



  /**
   * Get the element name.
   * 
   * @return the element name.
   */
  public String getElementName();



  /**
   * Set the element name.
   * 
   * @param elementName
   *          the element name.
   */
  public void setElementName(String elementName);



  /**
   * Get the element parent unique ID.
   * 
   * @return the element parent unique ID.
   */
  public UID getParentID();



  /**
   * Set the element parent unique ID.
   * 
   * @param parentID
   *          the element parent unique ID.
   */
  public void setParentID(UID parentID);

}
